
import axios from "./ajax";
//登录验证接口
export function login(data) {
  return axios({
    method: 'post',
    url: "login",
    data
  })
}
// //用户数据列表
export function users(data) {
  return axios({
    method: 'get',
    url: "users",
    params: data
  })
}
//添加用户
export function userss(data) {
  return axios({
    method: 'post',
    url: "users",
    data: data
  })
}
//左侧菜单权限
export function menu(params) {
  return axios({
    method: "get",
    url: 'menus',
    params
  })
}
//修改用户状态
export function xiu(data) {
  return axios({
    method: 'put',
    url: 'users/' + data.uId + '/state/' + data.type,
    data
  })
}
//根据ID查询用户信息
export function soui(data) {
  return axios({
    method: "get",
    url: 'users/' + data.id,
    data
  })
}
//编辑用户提交
export function bjyhtj(data) {
  return axios({
    method: 'put',
    url: 'users/' + data.id,
    data
  })
}
//删除单个用户
export function scdgyh(data) {
  return axios({
    method: 'delete',
    url: 'users/' + data.id,
    data
  })
}
//分配用户角色
export function fpyhjs(data) {
  return axios({
    method: 'put',
    url: 'users/' + data.id + '/role',
    data
  })
}
//角色列表
export function jslb(params) {
  return axios({
    method: 'get',
    url: 'roles',
    params
  })
}
//添加角色
export function tjjs(data) {
  return axios({
    method: 'post',
    url: 'roles',
    data
  })
}
//删除角色
export function scjs(data) {
  return axios({
    method: 'delete',
    url: 'roles/' + data.id,
    data
  })
}
//权限列表
export function qxlb(data) {
  return axios({
    method: 'get',
    url: 'rights/' + data.type,
    data
  })
}
//删除角色指定权限
export function zdjs(data) {
  return axios({
    method: 'delete',
    url: 'roles/' + data.roleId + '/rights/' + data.rightId,
    data
  })
}
//商品数据列表
export function splb(data) {
  return axios({
    method: 'get',
    url: 'goods',
    params: data
  })
}
//添加商品
export function tjsp(data) {
  return axios({
    method: 'post',
    url: 'goods',
    data
  })
}
//分类参数管理
export function flcs(data) {
  return axios({
    method: 'get',
    url: 'categories/' + data.id + '/attributes',
    data
  })
}
//商品数据列表
export function spsjlb(params) {
  return axios({
    method: 'get',
    url: 'categories',
    params
  })
}
//订单列表
export function ddlb(data) {
  return axios({
    method: 'get',
    url: 'orders',
    params: data
  })
}
//折线图
export function zxt(data) {
  return axios({
    method: 'get',
    url: 'reports/type/' + data.type,
    data
  })
}
//添加分类
export function tjfl(data) {

}
//商品分类
export function bgoodlist(data) {
  return axios({
    url: '/categories/' + data.id,
    method: 'put',
    params:data
  })
}
//删除商品分类
export function dgoodlist(data) {
  return axios({
    url: '/categories/' + data.id,
    method: 'delete',
    data
  })
}
//动静态
export function dongjing(data){
  return axios({
    url:'categories/'+data.id+'/attributes',
    method:'post',
    data
  })
}
//参数列表
export function dong(data){
  return axios({
    url:'categories/'+data.id+'/attributes',
    method:'get',
    params:data
  })
}